import { useI18n } from '/@/hooks/web/useI18n';
import { useMessage, ModalOptionsEx } from '/@/hooks/web/useMessage';
import { omit } from 'lodash-es';
/**
 * @param {ModalOptionsEx} option
 * @param {Fn} callback
 * @param {ModalOptionsEx} option
 */
export function batchConfirm(data, callback: Fn, option: ModalOptionsEx = { iconType: 'warning' }) {
  const { createConfirm } = useMessage();
  const { t } = useI18n();
  const confirmOption: ModalOptionsEx = {
    title: t('common.operationalAlerts'),
    content: () => (
      <div>
        物料<span style="color: red; font-size: 20px; margin: 0px 10px;">{data.ItemId}</span>
        {data.info}
      </div>
    ),
    onOk: () => callback(callback),
    ...omit(option, 'content'),
  };
  createConfirm(confirmOption);
}
